#ifndef AXURGLASER_H
#define AXURGLASER_H
#include "winsock2.h"
#include <Eigen/Dense>
#include <QThread>
#include "AxConfiguration.h"
#include "axmapcontrol.h"
#include "Urg_driver.h"
#include "AxExtrapolator.h"
#include "ariaUtil.h"
#include "AxRangeReading.h"

using namespace hrk;
class AxUrgLaser : public QThread
{
	Q_OBJECT
	
public:
	AxUrgLaser(QObject *parent);
	
	~AxUrgLaser();
	void setConfigration(AxConfiguration& config_);
	void setExtrapolator(AxExtrapolator* extrapolator_);
	void intial(AxMapControl *axMap, AxConfiguration &config_);
	void run(void);
	int openUrg(int port_);

	void startRecord();
	void stop();
	void save(AxRangeReading& reading);

public:
	Urg_driver urg_;
	bool is_pause;
	AxExtrapolator* extrapolator;
	AxConfiguration config;
	int idxInidcate;
	AxRangeReading* reading;
	QMutex global_Mutex;
signals:
	void receive_failed(const char* error_message);
	void received(void);
private:
	
};

#endif // AXURGLASER_H
